<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<html lang="zh-CN">
<head>
	<title>Showcase 示例</title>
	<style type="text/css">
		.hero-unit {position: relative;color: #fff;}
		.hero-unit h1 {letter-spacing: 0; color: #fff;}
		.hero-unit h1, .hero-unit p {text-shadow: 1px 1px 4px #000;}
		.hero-unit div.intro { position: relative;}
	
		/* sigma.js context : */
		.sigma-parent {position: relative; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; background: #222;}
		.sigma-expand {position: absolute;width: 100%;height: 100%;top: 0;left: 0;}
	</style>
</head>
<body>
	<div class="container-fluid">
		<div class="hero-unit">
			<div class="sigma-parent sigma-expand">
				<div class="sigma-expand" id="sigma-1"></div>
			</div>
			<div class="intro">
				<h1>掘金</h1>
				<p>立足大数据，洞悉大智慧，大数据不再大...</p>
			</div>
			<div class="sigma-expand" id="mouselayer-sigma-1"></div>
		</div>
		
		<div class="row-fluid">
			<div class="span4">
				<h2>海量数据</h2>
				<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
			</div>
			<div class="span4">
				<h2>社会分析</h2>
				<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
			</div>
			<div class="span4">
				<h2>信息挖掘</h2>
				<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
				<p><a class="btn" href="#">View details &raquo;</a></p>
			</div>
		</div>
		
		<div class="row-fluid">
			<div class="bs-docs-example">
				<p><strong>Nullam</strong> quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.</p>
				<p class="lead">Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.</p>
				<p><small>Maecenas</small> sed diam eget risus varius blandit sit amet non magna. <em>Donec</em> id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
				<p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
				<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
				<p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>
				<p class="text-info">Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.</p>
				<p class="text-success">Duis mollis, est non commodo luctus, <abbr title="attribute">attr</abbr> nisi erat porttitor ligula.</p>
				<div class="dropdown clearfix">
					<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
						<li><a tabindex="-1" href="#">Action</a></li>
						<li><a tabindex="-1" href="#">Another action</a></li>
						<li><a tabindex="-1" href="#">Something else here</a></li>
						<li class="divider"></li>
						<li class="dropdown-submenu">
							<a tabindex="-1" href="#">More options</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">Second level link</a></li>
								<li><a tabindex="-1" href="#">Second level link</a></li>
								<li><a tabindex="-1" href="#">Second level link</a></li>
							</ul>
						</li>
					</ul>
				</div>
			</div>
		</div>
		
		<div class="row-fluid">
			<ul class="thumbnails">
				<li class="span4">
					<div class="thumbnail">
						<img src="http://placehold.it/300x200" alt="">
						<div class="caption">
						<h3>Thumbnail label</h3>
						<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
						<p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
						</div>
					</div>
				</li>
				<li class="span4">
					<div class="thumbnail">
						<img src="http://placehold.it/300x200" alt="">
						<div class="caption">
						<h3>Thumbnail label</h3>
						<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
						<p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
						</div>
					</div>
				</li>
				<li class="span4">
					<div class="thumbnail">
						<img src="http://placehold.it/300x200" alt="">
						<div class="caption">
						<h3>Thumbnail label</h3>
						<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
						<p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
						</div>
					</div>
				</li>
			</ul>
		</div>
		
		<script src="${ctx}/static/sigma/sigma.fisheye.js"></script>
		<script type="text/javascript">
			function init() {
				function getRandomColor(a, b) {
					var r = Math.random();
					return 'rgb('+ ((a.r+(b.r-a.r)*r)|0).toString() + ','+ ((a.g+(b.g-a.g)*r)|0).toString() + ','+ ((a.b+(b.b-a.b)*r)|0).toString() + ')';
				};
		
				var colorFrom = {r: 32,g: 79,b: 25};
				var colorTo = {r: 180,g: 255,b: 158};
		
				/** sigma.js instance 1 (banner) : */
				s1 = sigma.init(document.getElementById('sigma-1')).configProperties({
					drawHoverNodes: false
				}).drawingProperties({
					labelThreshold: 10000,
					defaultEdgeType: 'curve'
				}).mouseProperties({
					mouseEnabled: false
				}).graphProperties({
					scalingMode: 'outside'
				});
		
				var i, N = 300, E = 600;
				for(i=0;i<N;i++){
					s1.addNode(i,{
						'x': Math.random(),
						'y': Math.random(),
						'size': 0.5+5*Math.random(),
						'color': getRandomColor(colorFrom,colorTo)
					});
				}
		
				for(i=0;i<E;i++){
					s1.addEdge(i,Math.random()*N|0,Math.random()*N|0);
				}
		
				s1.draw();
		
				var newParent = document.getElementById('mouselayer-sigma-1');
				var mouseLayer = document.getElementById('sigma_mouse_1');
				newParent.appendChild(mouseLayer);
		
				mouseLayer.addEventListener('mouseover', function() {
						s1.activateFishEye();
					}, true);
				mouseLayer.addEventListener('mouseout', function() {
						s1.desactivateFishEye().draw(2,2,2);
					}, true);
		
				/**
				 * Resize every instances on window resizing, and some divs :
				 */
				function resize(event){
					for(var key in sigma.instances) {
						sigma.instances[key].resize();
					}
				};
		
				window.onresize = resize;
				resize();
			}
		
			if (document.addEventListener) {
				document.addEventListener("DOMContentLoaded", init, false);
			} else {
				window.onload = init;
			}
		</script>
	</div>

</body>
</html>